package model.Entity.SIS;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the SIS_ACADEMIC_CALENDAR database table.
 * 
 */
@Embeddable
public class AcademicCalendarPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(insertable=false, updatable=false)
	private int semester;

	@Column(name="ITEM_CODE", insertable=false, updatable=false)
	private int itemCode;

	@Column(name="STUDY_CODE", insertable=false, updatable=false)
	private int studyCode;

	public AcademicCalendarPK() {
	}
	public int getSemester() {
		return this.semester;
	}
	public void setSemester(int semester) {
		this.semester = semester;
	}
	public int getItemCode() {
		return this.itemCode;
	}
	public void setItemCode(int itemCode) {
		this.itemCode = itemCode;
	}
	public int getStudyCode() {
		return this.studyCode;
	}
	public void setStudyCode(int studyCode) {
		this.studyCode = studyCode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof AcademicCalendarPK)) {
			return false;
		}
		AcademicCalendarPK castOther = (AcademicCalendarPK)other;
		return 
			(this.semester == castOther.semester)
			&& (this.itemCode == castOther.itemCode)
			&& (this.studyCode == castOther.studyCode);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.semester ^ (this.semester >>> 32)));
		hash = hash * prime + ((int) (this.itemCode ^ (this.itemCode >>> 32)));
		hash = hash * prime + ((int) (this.studyCode ^ (this.studyCode >>> 32)));
		
		return hash;
	}
}